const fs = require('fs')
const path = require('path')
const filePath = path.resolve(__dirname, "./fs.txt")

fs.readFile(filePath, function(err, data){
    if(err){
        throw new Error(err)
    }
    else{
        console.log(data.toString());
    }
})

fs.writeFileSync(filePath, 'xiaowen', {
    flag: 'a+'
})
